const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/am')
const db = mongoose.connection;

db.on('error',function(){
    console.log('数据库链接错误');
    
})
db.once('open',function(){
    console.log('数据库链接成功');
    
})
module.exports = db;